package com.jzo2o.customer.config;

import com.jzo2o.common.utils.JwtTool;
import com.jzo2o.customer.properties.ApplicationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import javax.annotation.Resource;
/**
 * JWT工具配置类，负责JwtTool的Spring Bean注册
 */
@Configuration
public class JwtConfiguration {

    @Resource
    private ApplicationProperties applicationProperties;

    /**
     * 注册JwtTool Bean，基于应用配置中的JWT密钥初始化
     * @return 初始化后的JwtTool实例
     */
    @Bean
    public JwtTool jwtTool() {
        return new JwtTool(applicationProperties.getJwtKey());
    }
}
